﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Manon.Core.IOC
{

    public class ResolverException : System.Exception
    {
        public Type DependencyType { get; internal set; }
        public IServiceProvider DependencyResolver { get; internal set; }

        public ResolverException(Type dependencyType, System.Exception innerException = null)
        : base(
            String.Format("Could not resolve type '{0}'.  Make sure you have configured your Ioc container for this type.  View the InnerException for more details.",
                dependencyType,
        innerException))
        {
            DependencyType = dependencyType;
        }

        //public ResolverException(Type dependencyType, System.Exception innerException = null)
        //    : base(
        //        String.Format("Could not resolve type '{0}' using the '{1}'.  Make sure you have configured your Ioc container for this type.  View the InnerException for more details.",
        //            dependencyType,
        //            Resolver.Current == null ? "" : Resolver.Current.GetType().Name),
        //    innerException)
        //{
        //    DependencyType = dependencyType;
        //    DependencyResolver = Resolver.Current;
        //}
    }
}
